package com.todo.common.common.enums;

/**
 * @author kaiwei
 * @date 2023-10-27 10:03:09
 */
public enum BizErrorCodeEnum implements BizEnum {
    SUCCESS(10000, "SUCCESS", "操作成功"),
    /**********系统异常定义*************/
    REQUEST_ERROR(10001, "REQUEST_ERROR", "异常接口调用"),
    PROCESS_FAIL(10002, "PROCESS_FAIL", "服务器处理失败"),
    TOO_MANY_REQUEST(10003, "TOO_MANY_REQUEST", "访问过于频繁"),
    PERMISSION_DENY(10004, "PERMISSION_DENY", "用户服务无权限"),
    AUTHENTICATION_EXPIRED(10005, "AUTHENTICATION_EXPIRED", "身份认证过期"),
    SUCCESS_EXIST(10006, "SUCCESS_EXIST", "记录已存在"),
    SUCCESS_ACCOUNT_NOT_EXIST(10007, "SUCCESS_ACCOUNT_NOT_EXIST", "账号不存在"),
    IP_LIMIT(10008, "IP_LIMIT", "IP限制"),
    PARAM_ERROR(10009, "PARAM_ERROR", "参数错误"),
    PARAM_IS_NULL(10010, "PARAM_IS_NULL", "参数为空"),
    INSUFFICIENT_USER_PERMISSIONS(10011, "INSUFFICIENT_USER_PERMISSIONS", "用户权限不足"),
    INVALID_METHOD(10012, "INVALID_METHOD", "方法名不存在"),
    REQUEST_API_NOT_FOUND(10013, "REQUEST_API_NOT_FOUND", "请求的方法名不存在"),
    INVALID_FORMAT(10014, "INVALID_FORMAT", "无效的数据格式"),
    MISSING_APP_KEY(10015, "MISSING_APP_KEY", "缺少AppKey参数"),
    INVALID_APP_KEY(10016, "INVALID_APP_KEY ", "非法的APP Key"),
    INVALID_ACCESS_TOKEN(10017, "INVALID_ACCESS_TOKEN", "无效的access token"),
    USER_DOES_NOT_EXISTS(10018, "USER_DOES_NOT_EXISTS", "用户不存在"),
    CONTENT_IS_NULL(10019, "CONTENT_IS_NULL", "内容为空"),
    CONTENT_IS_ILLEGAL(10020, "CONTENT_IS_ILLEGAL ", "包含非法内容"),
    PHONE_NUMBER_HAS_BEEN_USED(10020, "PHONE_NUMBER_HAS_BEEN_USED", "该手机号已经被使用"),
    AUTH_FAILED(10021, "AUTH_FAILED", "验证失败"),
    ILLEGAL_OPERATION(10022, "ILLEGAL_OPERATION", "非法操作"),
    USERNAME_OR_PASSWORD_ERROR(10023, "USERNAME_OR_PASSWORD_ERROR", "用户名或者密码错误"),
    OPERATION_FAILED(10024, "OPERATION_FAILED", "操作失败"),
    SYSTEM_ERROR(10025, "SYSTEM_ERROR", "系统异常"),
    CALL_SERVICE_ERROR(10026, "CALL_SERVICE_ERROR", "调用服务异常"),
    VERSION_ERROR(10027, "VERSION_ERROR", "版本号错误"),
    DATA_NOT_EXIST(10028, "DATA_NOT_EXIST", "数据不存在"),
    REPEAT_OPERATION(10029, "REPEAT_OPERATION", "重复操作"),
    PHONE_ERROR(10030, "PHONE_ERROR", "手机号异常"),
    OPERATE_AUTH_EXPIRE(10031, "OPERATE_AUTH_EXPIRE", "操作已过期"),
    OSS_UPLOAD_FAIL(10032, "OSS_UPLOAD_FAIL", "OSS上传异常"),

    /**********基础异常定义*************/
    LOGOUT_BY_LIMIT_STRATEGY(10200, "LOGOUT_BY_LIMIT_STRATEGY", "您账号已被强制登出"),
    LOGIN_FAILED_FIVE_TIMES(10201, "LOGIN_FAILED_FIVE_TIMES", "密码错误5次，您的账号已经被封停30分钟"),
    LOGIN_FAILED_WITH_TIMES(10202, "LOGIN_FAILED_WITH_TIMES", "密码错误{0}次"),
    SMSCODE_REQUEST_MORE_THEN_FIVE_TIMES(10203, "SMSCODE_REQUEST_MORE_THEN_FIVE_TIMES", "短信验证码请求次数过多，请30分钟之后再获取"),
    CHANGE_DEVICE_MORE_THEN_FIVE_TIMES(10204, "CHANGE_DEVICE_MORE_THEN_FIVE_TIMES", "切换设备过于频繁，您的账号已经被封停30分钟"),
    DIFF_LAST_LOGIN_DEVICE(10205, "DIFF_LAST_LOGIN_DEVICE", "您的账号尝试在非常用设备登陆，请用使用短信验证码方式重新登陆"),
    PASSWORD_ERROR(10206, "PASSWORD_ERROR", "密码错误"),
    SAME_PASSWORD(10207, "SAME_PASSWORD", "新旧密码相同"),
    SAME_USER_NAME(10208, "SAME_USER_NAME", "当前用户名重复"),
    CAPTCHA_ERROR(10209, "CAPTCHA_ERROR", "验证码错误"),
    PLACE_LOGIN_AGAIN(10210, "PLACE_LOGIN_AGAIN", "请重新登录"),

    NO_NEED_EXECUTE(11000, "NO_NEED_EXECUTE", "不需要执行"),
    TIMEOUT_INIT_ERROR(11001, "TIMEOUT_INIT_ERROR", "超时初始化失败"),
    QUANTITY_EXPLOSION(11002, "QUANTITY_EXPLOSION", "数量爆炸"),


    /**********业务异常定义*************/
    BASE_BUSINESS_ERROR(20001, "BASE_BUSINESS_ERROR", "业务异常"),
    RELATION_DATA_EXCESSIVE(20002, "RELATION_DATA_EXCESSIVE", "业务关联过量"),
    STRATEGY_USE_RECORD_ERROR(20003, "STRATEGY_USE_RECORD_ERROR", "攻略使用记录关联异常"),
    STRATEGY_STATUS_OPERATE_PROHIBITED(20004, "STRATEGY_STATUS_OPERATE_PROHIBITED", "当前攻略状态禁止操作"),
    INTERVAL_DAYS_ERROR(20005, "INTERVAL_DAYS_ERROR", "间隔天数异常"),
    COMMENTS_INFO_ILLEGAL(20005, "COMMENTS_INFO_ILLEGAL", "评论信息包含非法信息"),
    MEMO_RELATION_FAILED(20006, "MEMO_RELATION_FAILED", "备忘录关联失败"),

    //内容
    CONTENT_STATUS_OPERATE_PROHIBITED(21001, "CONTENT_STATUS_OPERATE_PROHIBITED", "当前内容状态禁止操作"),
    //消息
    TEMPLATE_NOT_FOUND(22001,"TEMPLATE_NOT_FOUND", "找不到模板或模板已被删除"),
    TOO_MANY_RECEIVER(22002,"TOO_MANY_RECEIVER", "传入的接收者大于100个"),


    SAME_EVENT_CODE(30001,"SAME_EVENT_CODE", "事件code已存在"),
    NOT_SUPPORT_EVENT_CLASSIFY(30002,"NOT_SUPPORT_EVENT_CLASSIFY", "当前支持且仅支持MQ消息分类"),
    NOT_SUPPORT_EVENT_FIELD(30003,"NOT_SUPPORT_EVENT_FIELD", "不支持的事件字段配置"),
    SAME_EVENT_NAME(30004,"SAME_EVENT_NAME", "事件名称已存在"),
    NOT_SUPPORT_OPERATE_STATUS(30005,"NOT_SUPPORT_OPERATE_STATUS", "不支持的操作状态"),
    EVENT_ACTIVITY_RUNNING(30006,"EVENT_ACTIVITY_RUNNING", "事件活动执行中，无法操作"),
    CORE_FIELD_MISSING(30007,"CORE_FIELD_MISSING", "核心字段缺失，无法执行后续流程"),
    EVENT_DETAIL_ACCESS_RULE_ERROR(30008,"EVENT_DETAIL_ACCESS_RULE_ERROR", "事件配置准入规则验证失败"),
    /**
     * pipeline
     */
    CONTEXT_IS_NULL(50001,"P0001", "流程上下文为空"),
    BUSINESS_CODE_IS_NULL(50002,"P0002", "业务代码为空"),
    PROCESS_TEMPLATE_IS_NULL(50003,"P0003", "流程模板配置为空"),
    PROCESS_LIST_IS_NULL(50004,"P0004", "业务处理器配置为空"),

    END(99999, "END", "不需要执行"),
    ;

    private int code;
    private String name;
    private String desc;

    private BizErrorCodeEnum(int code, String name, String desc) {
        this.code = code;
        this.name = name;
        this.desc = desc;
    }

    public int getCode() {
        return this.code;
    }

    public String getName() {
        return this.name;
    }

    public String getDesc() {
        return this.desc;
    }
}
